<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1"/>
<title>APR (Airport Rhapsody): monAirportRhapsodyDr.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">APR (Airport Rhapsody)
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">Implementation based on monitors</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.3.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('mon_airport_rhapsody_dr_8h.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">monAirportRhapsodyDr.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Problem name: Airport rhapsody.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;stdbool.h&gt;</code><br/>
</div>
<p><a href="mon_airport_rhapsody_dr_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a3dddbe6accfdb31334c187785e7adba4"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mon_airport_rhapsody_dr_8h.html#a3dddbe6accfdb31334c187785e7adba4">hasDaysWorkEnded</a> (void)</td></tr>
<tr class="memdesc:a3dddbe6accfdb31334c187785e7adba4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Has days work ended.  <a href="#a3dddbe6accfdb31334c187785e7adba4">More...</a><br/></td></tr>
<tr class="separator:a3dddbe6accfdb31334c187785e7adba4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0cb4c883a9512a176dd42233c8bf99f6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mon_airport_rhapsody_dr_8h.html#a0cb4c883a9512a176dd42233c8bf99f6">announcingBusBoarding</a> (void)</td></tr>
<tr class="memdesc:a0cb4c883a9512a176dd42233c8bf99f6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Announcing bus boarding.  <a href="#a0cb4c883a9512a176dd42233c8bf99f6">More...</a><br/></td></tr>
<tr class="separator:a0cb4c883a9512a176dd42233c8bf99f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab2fe1440f9d7ec3e6f43216e23a3a3ab"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mon_airport_rhapsody_dr_8h.html#ab2fe1440f9d7ec3e6f43216e23a3a3ab">goToDepartureTerminal</a> (void)</td></tr>
<tr class="memdesc:ab2fe1440f9d7ec3e6f43216e23a3a3ab"><td class="mdescLeft">&#160;</td><td class="mdescRight">Go to departure terminal.  <a href="#ab2fe1440f9d7ec3e6f43216e23a3a3ab">More...</a><br/></td></tr>
<tr class="separator:ab2fe1440f9d7ec3e6f43216e23a3a3ab"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a97a4baa843311807b3cd4f6d0c6c26a4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mon_airport_rhapsody_dr_8h.html#a97a4baa843311807b3cd4f6d0c6c26a4">parkTheBusAndLetPassOff</a> (void)</td></tr>
<tr class="memdesc:a97a4baa843311807b3cd4f6d0c6c26a4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Park the bus and let passengers off.  <a href="#a97a4baa843311807b3cd4f6d0c6c26a4">More...</a><br/></td></tr>
<tr class="separator:a97a4baa843311807b3cd4f6d0c6c26a4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af56adbaa8cfb36dbcd46a102eb8338e7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mon_airport_rhapsody_dr_8h.html#af56adbaa8cfb36dbcd46a102eb8338e7">goToArrivalTerminal</a> (void)</td></tr>
<tr class="memdesc:af56adbaa8cfb36dbcd46a102eb8338e7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Go to arrival terminal.  <a href="#af56adbaa8cfb36dbcd46a102eb8338e7">More...</a><br/></td></tr>
<tr class="separator:af56adbaa8cfb36dbcd46a102eb8338e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6c36f81609727306376b6c7c7989815a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mon_airport_rhapsody_dr_8h.html#a6c36f81609727306376b6c7c7989815a">parkTheBus</a> (void)</td></tr>
<tr class="memdesc:a6c36f81609727306376b6c7c7989815a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Park the bus.  <a href="#a6c36f81609727306376b6c7c7989815a">More...</a><br/></td></tr>
<tr class="separator:a6c36f81609727306376b6c7c7989815a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Problem name: Airport rhapsody. </p>
<p>(interface file)</p>
<p>Concept: António Rui Borges</p>
<p>Synchronization based on monitors. Both threads and the monitor are implemented using the pthread library which enables the creation of a monitor of the Lampson / Redell type.</p>
<p>Definition of the operations carried out by the bus driver thread: </p>
<ul>
<li>has day's work ended </li>
<li>announcing bus boarding </li>
<li>go to departure terminal </li>
<li>park the bus and let passengers off </li>
<li>go to arrival terminal </li>
<li>park the bus.</li>
</ul>
<dl class="section author"><dt>Author</dt><dd>António Rui Borges - December 2013 </dd></dl>
</div><h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a0cb4c883a9512a176dd42233c8bf99f6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void announcingBusBoarding </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Announcing bus boarding. </p>
<p>The bus driver checks if the queue is empty. If it is, he issues an error message. He then proceeds to summon passengers in the queue to board the bus. If some passenger identity is unknown, he issues an error message. He finally waits for the boarding to be complete.</p>
<p>No state should be saved. </p>

</div>
</div>
<a class="anchor" id="af56adbaa8cfb36dbcd46a102eb8338e7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void goToArrivalTerminal </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Go to arrival terminal. </p>
<p>The bus driver takes the bus back to the arrival transfer terminal.</p>
<p>State should be saved. </p>

</div>
</div>
<a class="anchor" id="ab2fe1440f9d7ec3e6f43216e23a3a3ab"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void goToDepartureTerminal </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Go to departure terminal. </p>
<p>The bus driver takes the bus to the departure transfer terminal.</p>
<p>State should be saved. </p>

</div>
</div>
<a class="anchor" id="a3dddbe6accfdb31334c187785e7adba4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool hasDaysWorkEnded </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Has days work ended. </p>
<p>The bus driver keeps waiting for passengers to transfer until his day's work has come to an end. He only proceeds if his day's work is indeed finished or there are passengers needing to be serviced.</p>
<p>No state should be saved.</p>
<dl class="section return"><dt>Returns</dt><dd><code>true</code>, if the day has come to the end </dd>
<dd>
<code>false</code>, if there are passengers needing to be serviced </dd></dl>

</div>
</div>
<a class="anchor" id="a6c36f81609727306376b6c7c7989815a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void parkTheBus </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Park the bus. </p>
<p>The parks the bus at the arrival transfer terminal.</p>
<p>State should be saved. </p>

</div>
</div>
<a class="anchor" id="a97a4baa843311807b3cd4f6d0c6c26a4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void parkTheBusAndLetPassOff </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Park the bus and let passengers off. </p>
<p>The bus driver checks if the bus is empty or overcrowded. If it is, he issues an error message. He then proceeds to summon passengers in the bus to exit. If some passenger identity is unknown, he issues an error message. He finally waits for the exit to be complete.</p>
<p>State should be saved. </p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="mon_airport_rhapsody_dr_8h.html">monAirportRhapsodyDr.h</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.3.1 </li>
  </ul>
</div>
</body>
</html>
